'use strict';

module.exports = app => {
  const { STRING, INTEGER, TEXT, DATE } = app.Sequelize;

  const ResumeProcessing = app.model.define('resume_processing', {
    record_id: {
      type: INTEGER,
      primaryKey: true,
      autoIncrement: true,
      comment: '记录编号',
    },
    delivery_id: {
      type: INTEGER,
      allowNull: true,
      comment: '投递编号',
    },
    company_id: {
      type: INTEGER,
      allowNull: true,
      comment: '企业编号',
    },
    company_name: {
      type: STRING(100),
      allowNull: false,
      comment: '公司名称',
    },
    position_id: {
      type: INTEGER,
      allowNull: true,
      comment: '岗位编号',
    },
    position_name: {
      type: STRING(100),
      allowNull: false,
      comment: '岗位名称',
    },
    user_id: {
      type: INTEGER,
      allowNull: false,
      defaultValue: 1,
      comment: '用户编号',
    },
    process_status: {
      type: INTEGER,
      allowNull: false,
      defaultValue: 1,
      comment: '处理状态 1-待处理 2-已通过 3-已打回 4-已过期',
    },
    reject_reason: {
      type: TEXT,
      allowNull: true,
      comment: '打回原因',
    },
    processor_id: {
      type: INTEGER,
      allowNull: true,
      comment: '处理人编号',
    },
    process_time: {
      type: DATE,
      allowNull: true,
      comment: '处理时间',
    },
    created_at: {
      type: DATE,
      allowNull: false,
      comment: '创建时间',
    },
  }, {
    tableName: 'resume_processing',
    timestamps: true,
    createdAt: 'created_at',
    updatedAt: false,
    comment: '简历处理表',
  });

  return ResumeProcessing;
};
